

{include file='common/header.html'}
<!-- 内容主体区域 -->
<div class="layui-body">
  <!--        <div style="padding: 15px;"><h1 style="font-weight: 700">欢迎界面</h1></div>-->
  <div id="user_container" style="padding: 15px;">
    <!--            面包屑导航-->
    <span class="layui-breadcrumb">
              <a href="#" style="font-weight: 700;color: #000!important;">首页</a>
              <a href="#" style="font-weight: 700;color: #000!important;">图书管理</a>
              <a href="" >数据报表</a>
            </span>
    <div class="layui-row layui-col-space15" style="margin-top: 15px">
      <div class="layui-col-md12">
        <div class="layui-panel" style="padding: 20px">
            <div id="main" style="width: 600px;height:400px;"></div>
        </div>
      </div>
    </div>
  </div>
</div>
</div>



<!--状态模板字符-->
<script type="text/html" id="currentTableBar">
  <a class="layui-btn layui-btn-normal layui-btn-sm data-count-edit" lay-event="edit"> <i class="layui-icon layui-icon-edit"></i></a>
  <a class="layui-btn layui-btn-sm layui-btn-danger data-count-delete" lay-event="delete"><i class="layui-icon layui-icon-delete"></i></a>
</script>


<script>
  document.querySelector('.layui-nav-itemed').classList.remove('layui-nav-itemed');
  $('a[href$=reports]').parent()[0].classList.add('layui-this');
  $('a[href$=reports]').parent().parent().parent()[0].classList.add('layui-nav-itemed');

  // 基于准备好的dom，初始化echarts实例


  var data1 = []
  var data2 = []
  $.get('/admins/reports/select',function (d) {
      var myChart = echarts.init(document.getElementById('main'));
      for (var i=0;i<d.length;i++){
          data1.push(d[i].lend_number)
          data2.push(d[i].bname)}
          // console.log(data2)
          // 指定图表的配置项和数据
          var option = {
              title: {
                  text: '图书借出情况'
              },
              color: [
                  '#91c7ae',
              ],
              tooltip: {},
              legend: {
                  data: ['解除数量']
              },
              xAxis: {
                  data: data2
              },
              yAxis: {},
              series: [
                  {
                      name: '数量',
                      type: 'bar',
                      data:data1
                  }
              ],

          };

          // 使用刚指定的配置项和数据显示图表。
          myChart.setOption(option);

  })



</script>


{include file='common/footer.html'}
